import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionServlet; import org.apache.struts.util.MessageResources; import MainForm; import java.util.List; import dwarf.MountainMgr; import dwarf.DwarfMgr; public class EnterMainAction extends Action { public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { MainForm mForm = (MainForm)form; DwarfMgr dm = MgrFactory.getDwarfMgr(); MountainMgr mm = MgrFactory.getMountainMgr(); mForm.setMountains(mm.GetAll()); mForm.setDwarves(dm.GetAll()); return (mapping.findForward("success")); } }